&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI adm2
&ANALYZE-RESUME
&Scoped-define WINDOW-NAME CURRENT-WINDOW


/* Temp-Table and Buffer definitions                                    */
DEFINE TEMP-TABLE ab_unmap
       FIELD auteur AS CHARACTER FORMAT "X(256)":U 
       FIELD descriptif AS CHARACTER FORMAT "X(256)":U 
       FIELD editeur AS CHARACTER FORMAT "X(256)":U 
       FIELD etat AS CHARACTER FORMAT "X(256)":U 
       FIELD image AS CHARACTER FORMAT "X(256)":U 
       FIELD isbn AS CHARACTER FORMAT "X(256)":U 
       FIELD lien AS CHARACTER FORMAT "X(256)":U 
       FIELD lien0 AS CHARACTER FORMAT "X(256)":U 
       FIELD lien1 AS CHARACTER FORMAT "X(256)":U 
       FIELD lien2 AS CHARACTER FORMAT "X(256)":U 
       FIELD poids AS CHARACTER FORMAT "X(256)":U 
       FIELD Prix AS CHARACTER FORMAT "X(256)":U 
       FIELD Prixbarre AS CHARACTER FORMAT "X(256)":U 
       FIELD ref AS CHARACTER FORMAT "X(256)":U 
       FIELD resume AS CHARACTER FORMAT "X(256)":U 
       FIELD sous_titre AS CHARACTER FORMAT "X(256)":U 
       FIELD titre AS CHARACTER FORMAT "X(256)":U .



&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS w-html 
/*------------------------------------------------------------------------

  File: 

  Description: 

  Input Parameters:
      <none>

  Output Parameters:
      <none>

  Author: 

  Created: 

------------------------------------------------------------------------*/
/*           This .W file was created with AppBuilder.                  */
/*----------------------------------------------------------------------*/

/* Create an unnamed pool to store all the widgets created 
     by this procedure. This is a good default which assures
     that this procedure's triggers and internal procedures 
     will execute in this procedure's storage, and that proper
     cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.

/* ***************************  Definitions  ************************** */

/* Preprocessor Definitions ---                                         */

/* Parameters Definitions ---                                           */

/* Local Variable Definitions ---                                       */


DEF            VAR buf-ref AS CHARACTER NO-UNDO.
DEF            VAR a-lang  AS INTEGER   NO-UNDO.

DEF VAR flag-libraire   AS LOGICAL                   NO-UNDO.
DEF VAR lst-hors        AS CHARACTER                 NO-UNDO.
DEF VAR buf-nocli       AS INTEGER                   NO-UNDO.
DEF VAR buf-csmt        AS INTEGER                   NO-UNDO.
DEF VAR buf-prefix      LIKE doce.prefix             NO-UNDO.
DEF VAR buf-nodoc       LIKE doce.nodoc              NO-UNDO.
DEF VAR cde-prefix      LIKE doce.prefix             NO-UNDO.

DEF VAR i               AS   INTEGER                 NO-UNDO.
DEF VAR j               AS   INTEGER                 NO-UNDO.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK 

/* ********************  Preprocessor Definitions  ******************** */

&Scoped-define PROCEDURE-TYPE Web-Object
&Scoped-define DB-AWARE no

&Scoped-define WEB-FILE tbr_fiche.html

/* Name of designated FRAME-NAME and/or first browse and/or first query */
&Scoped-define FRAME-NAME Web-Frame

/* Standard List Definitions                                            */
&Scoped-Define ENABLED-OBJECTS ab_unmap.auteur ab_unmap.descriptif ~
ab_unmap.editeur ab_unmap.etat ab_unmap.image ab_unmap.isbn ab_unmap.lien ~
ab_unmap.lien0 ab_unmap.lien1 ab_unmap.lien2 ab_unmap.poids ab_unmap.Prix ~
ab_unmap.Prixbarre ab_unmap.ref ab_unmap.resume ab_unmap.sous_titre ~
ab_unmap.titre 
&Scoped-Define DISPLAYED-OBJECTS ab_unmap.auteur ab_unmap.descriptif ~
ab_unmap.editeur ab_unmap.etat ab_unmap.image ab_unmap.isbn ab_unmap.lien ~
ab_unmap.lien0 ab_unmap.lien1 ab_unmap.lien2 ab_unmap.poids ab_unmap.Prix ~
ab_unmap.Prixbarre ab_unmap.ref ab_unmap.resume ab_unmap.sous_titre ~
ab_unmap.titre 

/* Custom List Definitions                                              */
/* List-1,List-2,List-3,List-4,List-5,List-6                            */

/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME



/* ***********************  Control Definitions  ********************** */


/* Definitions of the field level widgets                               */

/* ************************  Frame Definitions  *********************** */

DEFINE FRAME Web-Frame
     ab_unmap.auteur AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.descriptif AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.editeur AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.etat AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.image AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.isbn AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lien AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lien0 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lien1 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lien2 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.poids AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.Prix AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.Prixbarre AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.ref AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.resume AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.sous_titre AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.titre AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 60.63 BY 14.13.


/* *********************** Procedure Settings ************************ */

&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
   Type: Web-Object
   Allow: Query
   Frames: 1
   Add Fields to: Neither
   Editing: Special-Events-Only
   Events: web.output,web.input
   Other Settings: COMPILE
   Temp-Tables and Buffers:
      TABLE: ab_unmap W "?" ?  
      ADDITIONAL-FIELDS:
          FIELD auteur AS CHARACTER FORMAT "X(256)":U 
          FIELD descriptif AS CHARACTER FORMAT "X(256)":U 
          FIELD editeur AS CHARACTER FORMAT "X(256)":U 
          FIELD etat AS CHARACTER FORMAT "X(256)":U 
          FIELD image AS CHARACTER FORMAT "X(256)":U 
          FIELD isbn AS CHARACTER FORMAT "X(256)":U 
          FIELD lien AS CHARACTER FORMAT "X(256)":U 
          FIELD lien0 AS CHARACTER FORMAT "X(256)":U 
          FIELD lien1 AS CHARACTER FORMAT "X(256)":U 
          FIELD lien2 AS CHARACTER FORMAT "X(256)":U 
          FIELD poids AS CHARACTER FORMAT "X(256)":U 
          FIELD Prix AS CHARACTER FORMAT "X(256)":U 
          FIELD Prixbarre AS CHARACTER FORMAT "X(256)":U 
          FIELD ref AS CHARACTER FORMAT "X(256)":U 
          FIELD resume AS CHARACTER FORMAT "X(256)":U 
          FIELD sous_titre AS CHARACTER FORMAT "X(256)":U 
          FIELD titre AS CHARACTER FORMAT "X(256)":U 
      END-FIELDS.
   END-TABLES.
 */
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS

/* *************************  Create Window  ************************** */

&ANALYZE-SUSPEND _CREATE-WINDOW
/* DESIGN Window definition (used by the UIB) 
  CREATE WINDOW w-html ASSIGN
         HEIGHT             = 14.13
         WIDTH              = 60.63.
/* END WINDOW DEFINITION */
                                                                        */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB w-html 
/* *********************** Included-Libraries ************************* */

{src/web2/html-map.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME




/* ***********  Runtime Attributes and AppBuilder Settings  *********** */

&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
/* SETTINGS FOR WINDOW w-html
  VISIBLE,,RUN-PERSISTENT                                               */
/* SETTINGS FOR FRAME Web-Frame
   FRAME-NAME UNDERLINE                                                 */
/* SETTINGS FOR FILL-IN ab_unmap.auteur IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.descriptif IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.editeur IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.etat IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.image IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.isbn IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lien IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lien0 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lien1 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lien2 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.poids IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.Prix IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.Prixbarre IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.ref IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.resume IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.sous_titre IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.titre IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* _RUN-TIME-ATTRIBUTES-END */
&ANALYZE-RESUME

 



/* ************************  Control Triggers  ************************ */

&Scoped-define SELF-NAME ab_unmap.auteur
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.auteur w-html WEB.output
PROCEDURE ab_unmap.auteur.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     {&out} arti.auteur.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.descriptif
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.descriptif w-html WEB.output
PROCEDURE ab_unmap.descriptif.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR i AS INT.

  DO WITH FRAME {&FRAME-NAME}:
     REPEAT i = 1 TO NUM-ENTRIES(arti.DESCRIPTION,CHR(10)):
        {&out} ENTRY(i,arti.DESCRIPTION,CHR(10)).
        IF i <> NUM-ENTRIES(arti.DESCRIPTION,CHR(10))  THEN {&out} "<br />".
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.editeur
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.editeur w-html WEB.output
PROCEDURE ab_unmap.editeur.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     {&out} arti.editeur.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.etat
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.etat w-html WEB.output
PROCEDURE ab_unmap.etat.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR langue   AS INTEGER   NO-UNDO.
  DEF VAR lst-code AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
  
      langue = IF arti.ref BEGINS "D" THEN 1 ELSE 2.

      FIND erreur WHERE erreur.noerr = 101052
                    AND erreur.lang  = 2 NO-LOCK NO-ERROR.
      IF AVAILABLE erreur THEN lst-code = erreur.libel.

      FIND erreur WHERE erreur.noerr = 101053
                    AND erreur.lang  = a-lang /* langue */ NO-LOCK NO-ERROR.
      {&out} ENTRY(INDEX(lst-code,arti.stat1),erreur.libel).

  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.image
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.image w-html WEB.output
PROCEDURE ab_unmap.image.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR buf-nomimage AS CHARACTER NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:

     CASE SUBSTRING(LC(arti.ref),1,1):
         WHEN "F" THEN buf-nomimage = "images_e/f/" + LC(arti.ref) + ".jpg".
         WHEN "D" THEN buf-nomimage = "images_e/d/" + LC(arti.ref) + ".jpg".
         OTHERWISE     buf-nomimage = "images_e/a/" + LC(arti.ref) + ".jpg".
     END CASE.

     IF SEARCH(buf-nomimage) <> ? THEN 
        {&out} "<img src=~"/"  buf-nomimage "~" alt=~"" arti.titre "~" title=~"" arti.titre "~" />".
     ELSE IF buf-ref BEGINS "D" THEN
            {&out} "<img src=~"/images_e/pasdispo_d.jpg~" alt=~"" arti.titre "~" title=~"" arti.titre "~" />".
     ELSE {&out} "<img src=~"/images_e/pasdispo_f.jpg~" alt=~"" arti.titre "~" title=~"" arti.titre "~" />".
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.isbn
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.isbn w-html WEB.output
PROCEDURE ab_unmap.isbn.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     {&out} "ISBN " arti.ean.     
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lien
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lien w-html WEB.output
PROCEDURE ab_unmap.lien.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     IF INDEX("SRE",arti.stat1) = 0 AND (NOT flag-libraire OR
        CAN-DO(lst-hors,arti.TYPE)) THEN DO:
        IF a-lang = 1 THEN {&out} "<a href=~"/de/warenkorb/?retour=article&lang=1&id=" buf-ref "~">".
        ELSE {&out} "<a href=~"/fr/panier?retour=article&lang=2&id=" buf-ref "~">".
        {&out} "<img src=~"/themes/parvis/images/caddie.png~" alt=~"" arti.titre "~" title=~"" arti.titre "~" /></a>".
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lien0
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lien0 w-html WEB.output
PROCEDURE ab_unmap.lien0.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  /*
  DO WITH FRAME {&FRAME-NAME}:
     {&out} "<a href=~"fiche_right.htm?id=" arti.ref "~""
            "target=~"fiche_right~">".
     IF arti.ref BEGINS "D" THEN {&out} "Inhalt".
     ELSE                        {&out} "R�sum�".
      {&out} "~</a>".
  END.
  */
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lien1
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lien1 w-html WEB.output
PROCEDURE ab_unmap.lien1.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     DEF VAR i AS INT.

     DO WITH FRAME {&FRAME-NAME}:
         REPEAT i = 1 TO NUM-ENTRIES(arti.nomplv):
            {&out} ENTRY(i,arti.nomplv) "<br />".
         END.
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.poids
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.poids w-html WEB.output
PROCEDURE ab_unmap.poids.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     IF arti.poids <> 0 THEN DO:
         IF a-lang = 1 THEN {&out} "Gewicht ".
         ELSE {&out} "poids ".
/*         IF arti.ref BEGINS "D" THEN {&out} "Gewicht ".  */
/*         ELSE {&out} "poids ".                           */
        {&out} STRING(arti.poids * 1000,">>>>9 g").
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.Prix
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.Prix w-html WEB.output
PROCEDURE ab_unmap.Prix.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR buf-prix AS CHARACTER NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:

     FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                     apri.typr    = TRUE        AND
                     apri.ref     = arti.ref    AND
                     apri.noadr   = 0           AND
                     apri.csmt    = 0           AND
                     apri.codmon  = "EUR"       AND
                     apri.noprix  = 1           AND
                     apri.datfin >= TODAY       NO-LOCK NO-ERROR.

     IF AVAILABLE apri THEN buf-prix = STRING(apri.prix,"EUR -zzzz9.99").

     FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                          apri.typr    = TRUE        AND
                          apri.ref     = arti.ref    AND
                          apri.noadr   = 0           AND
                          apri.csmt    = 0           AND
                          apri.codmon  = "CHF"       AND
                          apri.noprix  = 1           AND
                          apri.datfin >= TODAY       NO-LOCK NO-ERROR.

     IF AVAILABLE apri THEN buf-prix = buf-prix + " - " 
                                     + STRING(apri.prix,"CHF -zzzz9.99").
     {&out} buf-prix.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.Prixbarre
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.Prixbarre w-html WEB.output
PROCEDURE ab_unmap.Prixbarre.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR buf-prix AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:

      FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                      apri.typr    = TRUE        AND
                      apri.ref     = arti.ref    AND
                      apri.noadr   = 0           AND
                      apri.csmt    = 0           AND
                      apri.codmon  = "EUR"       AND
                      apri.noprix  = 9           AND
                      apri.datfin >= TODAY       NO-LOCK NO-ERROR.

      IF AVAILABLE apri THEN buf-prix = STRING(apri.prix,"EUR -zzzz9.99").

      FIND LAST apri WHERE apri.nosoc   = arti.nosoc  AND
                           apri.typr    = TRUE        AND
                           apri.ref     = arti.ref    AND
                           apri.noadr   = 0           AND
                           apri.csmt    = 0           AND
                           apri.codmon  = "CHF"       AND
                           apri.noprix  = 9           AND
                           apri.datfin >= TODAY       NO-LOCK NO-ERROR.

      IF AVAILABLE apri THEN buf-prix = buf-prix + " - " 
                                      + STRING(apri.prix,"CHF -zzzz9.99").

      {&out} buf-prix.


  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.ref
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.ref w-html WEB.output
PROCEDURE ab_unmap.ref.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR lang AS INTEGER.

  lang = IF arti.ref BEGINS "D" THEN 1 ELSE 2.


  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = 100010
                   AND erreur.lang  = a-lang /* lang */ NO-LOCK NO-ERROR.
     IF AVAILABLE erreur THEN {&out} erreur.libel " ".
     {&out} arti.ref.
  END.
  
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.resume
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.resume w-html WEB.output
PROCEDURE ab_unmap.resume.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR i AS INT.

  DO WITH FRAME {&FRAME-NAME}:
     REPEAT i = 1 TO NUM-ENTRIES(arti.resume,CHR(10)):
        {&out} ENTRY(i,arti.resume,CHR(10)) "<br />".
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.sous_titre
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.sous_titre w-html WEB.output
PROCEDURE ab_unmap.sous_titre.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     {&out} arti.stitre.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.titre
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.titre w-html WEB.output
PROCEDURE ab_unmap.titre.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     {&out} arti.titre.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&UNDEFINE SELF-NAME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK w-html 


/* ************************  Main Code Block  ************************* */

/* Standard Main Block that runs adm-create-objects, initializeObject 
 * and process-web-request.
 * The bulk of the web processing is in the Procedure process-web-request
 * elsewhere in this Web object.
 */
{src/web2/template/hmapmain.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


/* **********************  Internal Procedures  *********************** */

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects w-html  _ADM-CREATE-OBJECTS
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
  Purpose:     Create handles for all SmartObjects used in this procedure.
               After SmartObjects are initialized, then SmartLinks are added.
  Parameters:  <none>
------------------------------------------------------------------------------*/

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE htmOffsets w-html  _WEB-HTM-OFFSETS
PROCEDURE htmOffsets :
/*------------------------------------------------------------------------------
  Purpose:     Runs procedure to associate each HTML field with its
               corresponding widget name and handle.
  Parameters:  
  Notes:       
------------------------------------------------------------------------------*/
  RUN readOffsets ("{&WEB-FILE}":U).
  RUN htmAssociate
    ("auteur":U,"ab_unmap.auteur":U,ab_unmap.auteur:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("descriptif":U,"ab_unmap.descriptif":U,ab_unmap.descriptif:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("editeur":U,"ab_unmap.editeur":U,ab_unmap.editeur:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("etat":U,"ab_unmap.etat":U,ab_unmap.etat:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("image":U,"ab_unmap.image":U,ab_unmap.image:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("isbn":U,"ab_unmap.isbn":U,ab_unmap.isbn:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lien":U,"ab_unmap.lien":U,ab_unmap.lien:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lien0":U,"ab_unmap.lien0":U,ab_unmap.lien0:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lien1":U,"ab_unmap.lien1":U,ab_unmap.lien1:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lien2":U,"ab_unmap.lien2":U,ab_unmap.lien2:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("poids":U,"ab_unmap.poids":U,ab_unmap.poids:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("Prix":U,"ab_unmap.Prix":U,ab_unmap.Prix:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("Prixbarre":U,"ab_unmap.Prixbarre":U,ab_unmap.Prixbarre:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("ref":U,"ab_unmap.ref":U,ab_unmap.ref:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("resume":U,"ab_unmap.resume":U,ab_unmap.resume:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("sous_titre":U,"ab_unmap.sous_titre":U,ab_unmap.sous_titre:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("titre":U,"ab_unmap.titre":U,ab_unmap.titre:HANDLE IN FRAME {&FRAME-NAME}).
END PROCEDURE.


/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE outputHeader w-html 
PROCEDURE outputHeader :
/*------------------------------------------------------------------------
  Purpose:     Output the MIME header, and any "cookie" information needed 
               by this procedure.  
  Parameters:  <none>
  Notes:       In the event that this Web object is state-aware, this is 
               a good place to set the WebState and WebTimeout attributes.
------------------------------------------------------------------------*/

  /* To make this a state-aware Web object, pass in the timeout period
   * (in minutes) before running outputContentType.  If you supply a 
   * timeout period greater than 0, the Web object becomes state-aware 
   * and the following happens:
   *
   *   - 4GL variables webState and webTimeout are set
   *   - a cookie is created for the broker to id the client on the return trip
   *   - a cookie is created to id the correct procedure on the return trip
   *
   * If you supply a timeout period less than 1, the following happens:
   *
   *   - 4GL variables webState and webTimeout are set to an empty string
   *   - a cookie is killed for the broker to id the client on the return trip
   *   - a cookie is killed to id the correct procedure on the return trip
   *
   * For example, set the timeout period to 5 minutes.
   *
   *   setWebState (5.0).
   */
    
  /* Output additional cookie information here before running outputContentType.
   *   For more information about the Netscape Cookie Specification, see
   *   http://home.netscape.com/newsref/std/cookie_spec.html  
   *   
   *   Name         - name of the cookie
   *   Value        - value of the cookie
   *   Expires date - Date to expire (optional). See TODAY function.
   *   Expires time - Time to expire (optional). See TIME function.
   *   Path         - Override default URL path (optional)
   *   Domain       - Override default domain (optional)
   *   Secure       - "secure" or unknown (optional)
   * 
   *   The following example sets custNum=23 and expires tomorrow at (about)
   *   the same time but only for secure (https) connections.
   *      
   *   RUN SetCookie IN web-utilities-hdl 
   *     ("custNum":U, "23":U, TODAY + 1, TIME, ?, ?, "secure":U).
   */ 
  output-content-type ("text/html":U).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE process-web-request w-html 
PROCEDURE process-web-request :
/*------------------------------------------------------------------------
  Purpose:     Process the web request.
  Notes:       
------------------------------------------------------------------------*/
     
  /* STEP 0 -
   * Output the MIME header and set up the object as state-less or state-aware. 
   * This is required if any HTML is to be returned to the browser. 
   *
   * NOTE: Move 'RUN outputHeader.' to the GET section below if you are going
   * to simulate another Web request by running a Web Object from this
   * procedure.  Running outputHeader precludes setting any additional cookie
   * information.
   */ 
  
  {client.i}

  RUN outputHeader.

  IF buf-nocli <> 0 THEN DO:
     FIND adrd WHERE adrd.nosoc = 1
                 AND adrd.noadr = buf-nocli
                 AND adrd.csmt  = 0 NO-LOCK NO-ERROR.

     FIND parmt WHERE parmt.nompar = "WEB-LIBRAIRE"
                  AND parmt.nomuti = ""
                  AND parmt.nosoc  = 0 NO-LOCK NO-ERROR.

     flag-libraire = AVAILABLE parmt AND CAN-DO(parmt.valpar,adrd.typc).

     FIND parmt WHERE parmt.nompar = "WEB-LIBRAIRE-ARTICLE"
                  AND parmt.nomuti = ""
                  AND parmt.nosoc  = 0 NO-LOCK NO-ERROR.
     lst-hors = IF AVAILABLE parmt THEN parmt.valpar ELSE "".
  END.

  /* Describe whether to receive FORM input for all the fields.  For example,
   * check particular input fields (using GetField in web-utilities-hdl). 
   * Here we look at REQUEST_METHOD. 
   */
  IF REQUEST_METHOD = "POST":U THEN DO:
    /* STEP 1 -
     * Copy HTML input field values to the Progress form buffer. */
    RUN inputFields.
    
    /* STEP 2 -
     * Open the database or SDO query and and fetch the first record. */ 
    RUN findRecords.
    
    /* STEP 3 -    
     * AssignFields will save the data in the frame.
     * (it automatically upgrades the lock to exclusive while doing the update)
     * 
     *  If a new record needs to be created set AddMode to true before 
        running assignFields.  
     *     setAddMode(TRUE).   
     * RUN assignFields. */
    
    /* STEP 4 -
     * Decide what HTML to return to the user. Choose STEP 4.1 to simulate
     * another Web request -OR- STEP 4.2 to return the original form (the
     * default action).
     *
     * STEP 4.1 -
     * To simulate another Web request, change the REQUEST_METHOD to GET
     * and RUN the Web object here.  For example,
     *
     *  ASSIGN REQUEST_METHOD = "GET":U.
     *  RUN run-web-object IN web-utilities-hdl ("myobject.w":U).
     */
     
    /* STEP 4.2 -
     * To return the form again, set data values, display them, and output 
     * them to the WEB stream.  
     *
     * STEP 4.2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.
   
    /* STEP 4.2b -
     * Enable objects that should be enabled. */
    RUN enableFields.

    /* STEP 4.2c -
     * OUTPUT the Progress form buffer to the WEB stream. */
    RUN outputFields.
    
  END. /* Form has been submitted. */
 
  /* REQUEST-METHOD = GET */ 
  ELSE DO:
    /* This is the first time that the form has been called. Just return the
     * form.  Move 'RUN outputHeader.' here if you are going to simulate
     * another Web request. */ 
   
    /* STEP 1 -
     * Open the database or SDO query and and fetch the first record. */ 
    RUN findRecords.
    
    a-lang   = INTEGER(get-field("lang")).
    buf-ref  = get-field("id").
    FIND arti WHERE arti.nosoc = 1
                AND arti.ref   = buf-ref NO-LOCK NO-ERROR.

    /* Return the form again. Set data values, display them, and output them
     * to the WEB stream.  
     *
     * STEP 2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.

    /* STEP 2b -
     * Enable objects that should be enabled. */
    RUN enableFields.

    /* STEP 2c -
     * OUTPUT the Progress from buffer to the WEB stream. */
    RUN outputFields.
  END. 
  
  /* Show error messages. */
  IF AnyMessage() THEN 
  DO:
     /* ShowDataMessage may return a Progress column name. This means you
      * can use the function as a parameter to HTMLSetFocus instead of 
      * calling it directly.  The first parameter is the form name.   
      *
      * HTMLSetFocus("document.DetailForm",ShowDataMessages()). */
     ShowDataMessages().
  END.
 
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

